import request from '@/utils/request'

const api_name = '/cmsservice/banner'

export default {
  // 添加课程信息
  addBannerInfo(banner) {
    return request({
      url: `${api_name}/addBanner`,
      method: 'post',
      data: banner
    })
  },
  // 获取课程信息
  getBannerInfo(id) {
    return request({
      url: `${api_name}/getBanner/${id}`,
      method: 'get'
    })
  },
  // 修改课程信息
  updateBannerInfo(banner) {
    return request({
      url: `${api_name}/updateBanner`,
      method: 'put',
      data: banner
    })
  },
  // 分页查询
  getPageList(page, limit) {
    return request({
      url: `${api_name}/banners/${page}/${limit}`,
      method: 'get'
    })
  },
  // 删除课程
  removeById(id) {
    return request({
      url: `${api_name}/remove/${id}`,
      method: 'delete'
    })
  }
}
